/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.colegiatura.be.GradoProfesional;

/**
 *
 * @author ADMINISTRADOR
 */
@Stateless
public class GradoProfesionalFacade implements GradoProfesionalFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(GradoProfesional gradoProfesional) {
        em.persist(gradoProfesional);
    }

    public void edit(GradoProfesional gradoProfesional) {
        em.merge(gradoProfesional);
    }

    public void remove(GradoProfesional gradoProfesional) {
        em.remove(em.merge(gradoProfesional));
    }

    public GradoProfesional find(Object id) {
        return em.find(GradoProfesional.class, id);
    }

    public List<GradoProfesional> findAll() {
        return em.createQuery("select object(o) from GradoProfesional as o").getResultList();
    }

}
